
package com.insigma.business.qrcode.intell.service.impl;



import com.insigma.business.qrcode.common.service.SequenceGenerator;
import com.insigma.business.qrcode.intell.dao.CommonPolicyDao;
import com.insigma.business.qrcode.intell.dto.CommonPolicyBSearcher;
import com.insigma.business.qrcode.intell.entity.CommonPolicyDO;
import com.insigma.business.qrcode.intell.service.CommonPolicyService;
import com.insigma.business.qrcode.soldier.dto.SequenceNameConstant;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service("commonPolicyService")
public class CommonPolicyServiceImpl implements CommonPolicyService {

    @Autowired(required = false)
    private CommonPolicyDao commonPolicyDao;
    @Autowired(required = false)
    private SequenceGenerator sequenceGenerator;

    
    @Override
    public List<CommonPolicyDO> search(final CommonPolicyBSearcher commonPolicyBSearcher) {
        return commonPolicyDao.search(commonPolicyBSearcher);
    }

    @Override
    public CommonPolicyDO get(final String id){
        return commonPolicyDao.get(id);
    }


    @Override
    public Integer insert(final CommonPolicyDO commonPolicyDO){
        commonPolicyDO.setId(sequenceGenerator.genKey(SequenceNameConstant.COMMON_POLICY_ID));
        return commonPolicyDao.insert(commonPolicyDO);
    }

    @Override
    public Integer getMaxTopWeight() {
        return commonPolicyDao.getMaxTopWeight();
    }


    @Override
    public Integer update(final CommonPolicyDO commonPolicyDO){
        return commonPolicyDao.update(commonPolicyDO);
    }


    @Override
    public Integer delete(final String id, final String modifierType, final String modifierId){
        return commonPolicyDao.delete(id,modifierType,modifierId);
    }


}
